package app

import (
	"github.com/jassue/go-storage/kodo"
	"github.com/jassue/go-storage/local"
	"github.com/jassue/go-storage/oss"
	"go-demo/common/global"
)

type StorageApp struct {
}

func NewStorageApp() StorageApp {
	return StorageApp{}
}
func (s StorageApp) Load() {
	if global.App.Config.StorageConfig.Enable.LocalEnable {
		_, _ = local.Init(global.App.Config.StorageConfig.Disks.Local)
	}
	if global.App.Config.StorageConfig.Enable.QiNiuEnable {
		_, _ = kodo.Init(global.App.Config.StorageConfig.Disks.QiNiu)
	}
	if global.App.Config.StorageConfig.Enable.AliOssEnable {
		_, _ = oss.Init(global.App.Config.StorageConfig.Disks.AliOss)
	}
}
